<?php  

if(!isset($default)){
    $default = 7700000000000;
}
 
?>

<div class="select_value">
    <fieldset >
        <legend>
            <b>выбор региона поиска</b>
        </legend>
        <select id="obl_id" name="obl_id">
            <?php foreach ($ar as $i):
     
            ?>
            
            <option
            <?php
             
            
            if ($default == $i['code']) { echo ' selected="selected" ';
            }
            ?>  
            onclick='search_region("<?php echo $i['code'];?>")' value="<?php echo $i['code'];?>"><?php echo $i['region'];?></option>
            <?php endforeach;?>
        </select>
    </fieldset>
</div>
<div class="select_value" id='city_metro'>
    <fieldset >
        <legend>
            <b id="sct"> <?php  	if( $default == '7700000000000' ||  $default == '7800000000000'){
            ?>выбор улицы<?php }else{?>выбор города<?php }?></b>
        </legend>
        <p id='select_st'></p>
        <p>
            <input  value="" id='searchs'/>
            <a onclick="search_city_metro();">поиск</a>
        </p>
        <div id="select_ch"></div>
    </fieldset>
</div>
<div style="display:none;">
    <input name="r" id="r" value="<?php echo $default;?>" id='r'/>
</div>
